package org.gavin.core.enums;

import org.gavin.core.domain.Status;

/**
 * Status 响应状态
 * @author Kiss1
 * @since 2023/09/28
 */
public enum CommonStatus implements Status {
    /**
     * 操作成功 0 - 2999
     */
    OK(200, "操作成功!"),
    /**
     * 拒绝访问 3000 - 3999
     */
    ACCESS_DENIED(3000,"拒绝访问!"),
    ACCESS_LIMIT(3001,"请求超限!"),
    /**
     * 参数错误 相关错误 4000 - 4999
     */
    PARAM_ERROR(4000,"参数错误!"),

    JSON_ERROR(4001,"JSON解析异常!"),

    REQUEST_FORMAT_ERROR(4002,"请求类型错误!"),

    NO_HANDLER_FOUND_ERROR(4003,"请求未被处理!"),

    NO_PATH_FOUND_ERROR(4004,"资源未找到!"),

    REQUEST_NOT_SUPPORT_ERROR(4005,"请求不被支持!"),

    LACK_HEADER_PARAM_ERROR(4006,"缺少请求头参数错误!"),

    ENCRYPTION_NOT_YET_ACTIVATED(4007,"暂未开通的加密方式!"),
    /**
     *  服务启失败 5000 - 5999
     */
    fail(5000,"操作失败"),

    /**
     * 加密相关错误 7000 - 7999
     */
    CIPHERTEXT_HANDLE_FAILED(7000,"密文处理失败!"),
    /**
     * JSON 数据转换异常
     */
    JSON_CONVERT_FAILED(7001,"JSON 数据转换异常!"),
    /**
     * 配置相关错误 8000 - 8999
     */
    CONFIG_ERROR(8000,"配置信息错误!"),

    BEAN_NOT_FIND(8001,"没有找到相关实现类!");

    
    private Integer code;
    
    private String msg;
    
    
    CommonStatus(Integer code,String msg){
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
